import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import { createPinia } from 'pinia';
import * as Icons from '@element-plus/icons-vue'
const pinia = createPinia()

const app = createApp(App)

app.use(pinia)
.use(store)
.use(router)
.use(ElementPlus, {
  locale: zhCn,
})
.mount('#app')
// 全局挂载和注册 element-plus 的所有 icon
app.config.globalProperties.$icons = []
Object.keys(Icons).forEach(key => {

  app.config.globalProperties.$icons.push(key)
  app.component(key, Icons[key as keyof typeof Icons])
})
